package edu.rpi.cs.android;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;

public class mainWindow extends Activity {
	
	Accounts a = new Accounts();
	
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.home2);
        ListView acctList = (ListView)findViewById(R.id.acct_list);
        ArrayAdapter<String> adpt;
        adpt = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,a.dispAccts);
        acctList.setAdapter(adpt);
        
        final Button add_button = (Button)findViewById(R.id.add);

        
        add_button.setOnClickListener(new View.OnClickListener() {
        	public void onClick(View view) {
        			Intent i = new Intent(mainWindow.this, newaccount.class);
        			startActivity(i);
        			
        		}
    });
    }
}